home *** CD-ROM | disk | FTP | other *** search
/ Nautilus 1992 July / Nautilus-3-8 / Nautilus-3-8.bin / Tools & Utilities / Techy Stuff / Doco ƒ / CSMP ƒ / CSMP-V1-097.TXT < prev    next >
Encoding:
Text File  |  1992-06-30  |  34.1 KB  |  967 lines

  1. C.S.M.P. Digest             Wed, 27 May 92       Volume 1 : Issue 97
  2.  
  3. Today's Topics:
  4.  
  5.     *** NEEDED: 24-Bit graphics sources, or help!!!  ***
  6.     Do Prograph/Serius do video?
  7.     Prograph mailing list.
  8.     Mac Pascal Programming Primer (book review and comments)
  9.     List Box LDEF with icons
  10.     Precompiled version of MacApp.h
  11.     ResEdit and 7.0
  12.  
  13.  
  14. The Comp.Sys.Mac.Programmer Digest is moderated by Michael A. Kelly.
  15.  
  16. These digests are available (by using FTP, account anonymous, your email
  17. address as password) in the pub/mac/csmp-digest directory on ftp.cs.uoregon.
  18. edu.  This is also the home of the comp.sys.mac.programmer Frequently Asked
  19. Questions list.  The last several issues of the digest are available from
  20. sumex-aim.stanford.edu as well.
  21.  
  22. These digests are also available via email.  Just send a note saying that you
  23. want to be on the digest mailing list to mkelly@cs.uoregon.edu, and you will
  24. automatically receive each new digest as it is created.
  25.  
  26. The digest is a collection of articles from the internet newsgroup comp.sys.
  27. mac.programmer.  It is designed for people who read c.s.m.p. semi-regularly
  28. and want an archive of the discussions.  If you don't know what a newsgroup
  29. is, you probably don't have access to it.  Ask your systems administrator(s)
  30. for details.  (This means you can't post questions to the digest.)
  31.  
  32. The articles in these digests are taken directly from comp.sys.mac.programmer.
  33. They are not edited; all articles included in this digest are in their original
  34. posted form.  The only articles that are -not- included in these digests are
  35. those which didn't receive any replies (except those that give information
  36. rather than ask a question).  All replies to each article are concatenated
  37. onto the original article in the order in which they were received.  Article
  38. threads are not added to the digests until the last article added to the
  39. thread is at least one month old (this is to ensure that the thread is dead
  40. before adding it to the digests).
  41.  
  42. Send administrative mail to mkelly@cs.uoregon.edu.
  43.  
  44. -------------------------------------------------------
  45.  
  46. From: talarico@rodan.acs.syr.edu (John F. Talarico)
  47. Subject: *** NEEDED: 24-Bit graphics sources, or help!!!  ***
  48. Date: 24 Apr 92 19:12:06 GMT
  49. Organization: Syracuse University, Syracuse, NY
  50.  
  51. HELP!!
  52.  
  53.     I need help producing 24-bit images on a Mac IIfx w/ ThinkPascal 4.0.
  54.  
  55. I was wondering if anyone had any examples of code that draw images in 24-bit
  56. color like Mandelbrot sets, etc.  I only need the sections that sets up the
  57. palette, and accesses each individual color by # (i.e. black =0 and misc.color
  58. (maximum intensity) = somelargenumber).
  59.  
  60. I would like some information soon.... Finals are around the corner  ;)
  61.  
  62.  
  63. If this means anything to anyone, I'm using it to produce 2-D graphs of the
  64. logistic function's Lyapunov exponent.  I want to plot many (more than 256)
  65. different intensity/saturation levels of one hue.
  66.  
  67. Thanx in advance...
  68. JT
  69.  
  70. (Cogito Ergo Pingo)
  71.  
  72.  
  73. - --
  74. _______________________________________________________________________________
  75. "... I speak                   |    I am:  John Talarico  (Elvis-at-large)
  76.        for the                 |  I'm at:  Syracuse University  (Prison)
  77. __________trees. "__the Lorax__|  a.k.a.:  TALARICO@MAILBOX.SYR.EDU (Go figure)
  78.  
  79. +++++++++++++++++++++++++++
  80.  
  81. From: mlanett@void.ncsa.uiuc.edu (Mark Lanett)
  82. Date: 25 Apr 92 23:32:29 GMT
  83. Organization: University of Illinois at Urbana
  84.  
  85. talarico@rodan.acs.syr.edu (John F. Talarico) writes:
  86.  
  87. >HELP!!
  88. >    I need help producing 24-bit images on a Mac IIfx w/ ThinkPascal 4.0.
  89.  
  90. >I was wondering if anyone had any examples of code that draw images in 24-bit
  91. >color like Mandelbrot sets, etc.  I only need the sections that sets up the
  92. >palette, and accesses each individual color by # (i.e. black =0 and misc.color
  93. >(maximum intensity) = somelargenumber).
  94.  
  95. Er, um, 24-bit images are "direct," i.e. they don't use palettes. Neither do
  96. 16-bit images, though I'd prefer it if they did. Just turn your values into
  97. RGB and plot them directly. In no particular language or toolbox:
  98.     plot( x,y,color(value,value,value)) // gives you grayscale
  99. - -- 
  100. Mark Lanett, Software Tools Group, NCSA; mlanett@uiuc.edu; NCSA.STG (AppleLink)
  101.  
  102. ---------------------------
  103.  
  104. From: tlt38517@uxa.cso.uiuc.edu (Terry Thiel)
  105. Subject: Do Prograph/Serius do video?
  106. Organization: University of Illinois at Urbana
  107. Date: Wed, 22 Apr 1992 23:13:55 GMT
  108.  
  109. We are working on a project that requires an app that will handle cutting and 
  110. pasting video and filing shots into a database.  I need to be able to customize 
  111. this database in many different ways.  Does Serius or Prograph have a video 
  112. module of some sort?  I know that either one will be perfect for the database 
  113. but it would be great if they also had video capabilities.  Thanks for any 
  114. info.
  115. - -Terry 
  116.  
  117. +++++++++++++++++++++++++++
  118.  
  119. From: timothy@ccu1.aukuni.ac.nz (Tim Bates)
  120. Date: Sat, 25 Apr 1992 02:56:49 GMT
  121. Organization: University of Auckland, New Zealand.
  122.  
  123. tlt38517@uxa.cso.uiuc.edu (Terry Thiel) writes:
  124.  
  125. >We are working on a project that requires an app that will handle cutting and 
  126. >pasting video and filing shots into a database.  I need to be able to customize 
  127. >this database in many different ways.  Does Serius or Prograph have a video 
  128. >module of some sort?  I know that either one will be perfect for the database 
  129. >but it would be great if they also had video capabilities.  Thanks for any 
  130. >info.
  131. >-Terry 
  132.  
  133. No idea about Serius.
  134.  
  135. Prograph has a working database application that comes as an example program.
  136. It also supports quicktime calls. Therefore you can show video in a database
  137. quite easily.
  138.  
  139. tim bates
  140.  
  141. +++++++++++++++++++++++++++
  142.  
  143. From: creedont@ohsu.edu (Thomas A. Creedon)
  144. Date: 24 Apr 92 22:26:03 GMT
  145. Organization: Oregon Hearing Research Center
  146.  
  147. In article <1992Apr22.231355.18770@news.cso.uiuc.edu>, tlt38517@uxa.cso.uiuc.edu (Terry Thiel) writes:
  148. > We are working on a project that requires an app that will handle cutting and 
  149. > pasting video and filing shots into a database.  I need to be able to customize 
  150. > this database in many different ways.  Does Serius or Prograph have a video 
  151. > module of some sort?  I know that either one will be perfect for the database 
  152. > but it would be great if they also had video capabilities.  Thanks for any 
  153. > info.
  154. > -Terry 
  155.  
  156. Prograph has an extension to work with Quicktime.  I've been using
  157. Prograph for the last several months and find working with it
  158. enjoyable.  I can't give you a comparison between Prograph and Serius.
  159.  
  160. Toodle-looooooooo........
  161. Thomas
  162. creedont@ohsu.edu
  163.  
  164. ---------------------------
  165.  
  166. From: tlt38517@uxa.cso.uiuc.edu (Terry Thiel)
  167. Subject: Prograph mailing list.
  168. Date: 24 Apr 92 19:50:32 GMT
  169. Organization: University of Illinois at Urbana
  170.  
  171. How do you get on the Prograph mailing list?  I was on it but need to get back
  172. on since I will be doing some developing with Prograph.  Has there been any
  173. consideration of a Prograph newsgroup?
  174. - -Terry
  175.  
  176. +++++++++++++++++++++++++++
  177.  
  178. From: mwalker@wc.novell.com (Mel Walker)
  179. Organization: Novell, Inc. - Walnut Creek
  180. Date: Fri, 24 Apr 1992 22:28:52 GMT
  181.  
  182. In article <1992Apr24.195032.27177@news.cso.uiuc.edu> tlt38517@uxa.cso.uiuc.edu (Terry Thiel) writes:
  183. >How do you get on the Prograph mailing list?  I was on it but need to get back
  184. >on since I will be doing some developing with Prograph.  Has there been any
  185. >consideration of a Prograph newsgroup?
  186. >-Terry
  187.  
  188. I would like to know as well.
  189. Thanks,
  190. - --Mel Walker
  191. mwalker@optics.wc.novell.com
  192.  
  193. +++++++++++++++++++++++++++
  194.  
  195. From: timothy@ccu1.aukuni.ac.nz (Tim Bates)
  196. Date: Sat, 25 Apr 1992 03:02:10 GMT
  197. Organization: University of Auckland, New Zealand.
  198.  
  199. mwalker@wc.novell.com (Mel Walker) writes:
  200.  
  201. >(Terry Thiel) writes:
  202. >>How do you get on the Prograph mailing list?
  203. >>stuff deleted
  204. >>consideration of a Prograph newsgroup?
  205. >>-Terry
  206. >I would like to know as well.
  207. >Thanks,
  208. >--Mel Walker
  209. >mwalker@optics.wc.novell.com
  210.  
  211. the prograph list is <info-prograph-request@grove.iup.edu>
  212.  
  213. I would like a Prograph newsgroup also, mainly for the chance to grow
  214. the communicating Prograph user community.
  215. I guess there is nothing stopping anyone writing directly to com.mac.prog
  216. with Prograph questions.
  217.  
  218.  
  219. tim bates
  220.  
  221.  
  222. ---------------------------
  223.  
  224. From: wstomv@wsinpa01.win.tue.nl (Tom Verhoeff)
  225. Subject: Mac Pascal Programming Primer (book review and comments)
  226. Date: 26 Apr 92 13:38:37 GMT
  227.  
  228.  
  229. Short review of and comments on:
  230.  
  231.     Macintosh Pascal Programming Primer, Volume I
  232.     Inside the Toolbox Using THINK Pascal
  233.     by Dave Mark & Cartwright Reed
  234.     Addison-Wesley, 1991
  235.     ISBN 0-201-57084-X
  236.  
  237.  
  238. Review
  239. - ------
  240.  
  241. This book is aimed at the beginning Mac-programmer, not the beginning
  242. programmer.  It assumes you are familiar with Pascal, though not
  243. necessarily THINK Pascal.  You learn how to build some basic
  244. stand-alone applications.  It covers the particular aspects of THINK
  245. Pascal (version 3) needed for this and also introduces you to ResEdit
  246. (version 2.0).  But the bulk of the material is concerned with the Mac
  247. Toolbox and Operating System.
  248.  
  249. The book does not overwhelm you with the ins and outs of every Toolbox
  250. routine.  The intention is to get you started right away.  It sketches
  251. the big picture and illustrates each topic in isolation with a minimal,
  252. but real, stand-alone application.  The integration of all these bits
  253. and pieces into full-blown applications is left to the reader's
  254. imagination.  For more detailed information you are often referred to
  255. Inside Macintosh, which is the defining text for the Macintosh Toolbox
  256. and Operating System.
  257.  
  258. The book was adapted from "Macintosh C Programming Primer" by the same
  259. authors.  Some traces of C programming practice can be recognized in
  260. the Pascal version.  I found the Pascal style awkward at times.  The
  261. book also contains some serious coding bugs.  Nevertheless, I did learn
  262. a lot from it in very little time.
  263.  
  264. Let me now be more specific in my comments.  These comments are phrased
  265. as suggestions to the authors, but every reader can benefit from them.
  266.  
  267.  
  268. General remarks about the code
  269. - ------- ------- ----- --- ----
  270.  
  271.     * Instead of
  272.     
  273.         done := FALSE;
  274.         while (done = FALSE) do begin "statements" end
  275.         
  276.       at least write
  277.       
  278.         done := FALSE;
  279.         while not done do begin "statements" end
  280.         
  281.       but preferrably even write
  282.       
  283.           done := FALSE;
  284.         repeat "statements" until done
  285.     
  286.     * Use with-statements to simplify the code; for example, in
  287.       SetUpSizeRect (p.135) you can write:
  288.       
  289.           procedure SetUpSizeRect;
  290.         begin
  291.         with gSizeRect do begin
  292.             top := MIN_WINDOW_HEIGHT;
  293.             left := MIN_WINDOW_WIDTH;
  294.             bottom := MAXINT;
  295.             right := MAXINT;
  296.             end
  297.         end;
  298.     
  299.     * Do more error handling right from the beginning (e.g. detecting
  300.       returned nil pointers).  Something like
  301.       
  302.         procedure Assert(condition:boolean; message:Str255);
  303.         begin
  304.         if not condition then begin
  305.           ShowText;
  306.           writeln(message);
  307.           halt
  308.           end
  309.         end;
  310.         
  311.       suffices for initial debugging. It need not put up alerts with
  312.       fancy texts.  I once had a problem with a wrong resource ID in
  313.       EventTutor, which does no checking.  For example, in WindowInit
  314.       (p.134) do:
  315.       
  316.           gPictWindow := GetNewWindow(...);
  317.         Assert(gPictWindow <> nil,'gPictWindow resource not found');
  318.  
  319.  
  320. Localized remarks
  321. - --------- -------
  322.  
  323. p.117    This is C code, instead of Pascal:
  324.  
  325.         gotOne := GetNextEvent( (mDownMask |
  326.                    keyDownMask), &gTheEvent );
  327.            
  328.     should read
  329.     
  330.         gotOne := GetNextEvent( mDownMask + keyDownMask, gTheEvent );
  331.  
  332. p.129    It might be nice to point out (again) that the project's resource file
  333.     should be set with the Run Options command.
  334.     
  335. p.129    (First bullet): "You called SelectWindow..."  The code only calls
  336.     SelectWindow in response to a mouseDown event that is inContent.
  337.     So what is the real explanation?
  338.  
  339. p.132    The constant DRAG_THRESHOLD is not referenced in EventTutor.  What
  340.     is its purpose?  Is something missing?
  341.  
  342. p.135    Use MAXINT instead of 32767 in SetUpSizeRect.
  343.  
  344. p.135    Inside Macintosh VI-3-18 recommends a more elaborate approach to
  345.     determine availability of WaitNextEvent.
  346.  
  347. p.135/6    I had a hard time locating trap numbers (while verifying the code to
  348.     determine availability of WaitNextEvent).  It took me a while to find
  349.     out that they are mentioned in the Appendices of Inside Macintosh
  350.     (its Index is of little help here; I am a real beginning Mac-programmer     :-).  Although there is an official Unimplemented trap, it is
  351.     mentioned only implicitly in Inside Macintosh VI-3-18.  Its actual
  352.     full address is $A89F (cf. Technical Note #156).
  353.  
  354. p.136    You could simply count the number of null events, instead of showing
  355.     them individually.  N.B. The rate at which null events are received
  356.     also depends on constant SLEEP.
  357.     
  358.     At first I saw no null events reported after I had uncommented the
  359.     relevant DrawEventString.  This is due to a bug in HandleEvent: the
  360.     line "if gotOne then" should be deleted (gotOne is false when a null
  361.     event is returned by either GetNextEvent or WaitNextEvent).  This
  362.     bug is present on pages 125 and 444 as well.
  363.  
  364.     I also wondered why I received no keyUp events.  It took me a while
  365.     to figure out that the default global system event mask is set to
  366.     eliminate keyUp events (cf. Inside Macintosh I-254).  Use
  367.     SetEventMask(everyEvent) (cf. Inside Macintosh II-70) on
  368.     initialization to receive keyUp events.
  369.  
  370. p.138/40  You can use GetWTitle on updateEvt and activateEvt to unify the code,
  371.     thereby avoiding unnecessary duplication.
  372.  
  373. p.141    N.B. EventTutor needs to do InitCursor to set the cursor from a
  374.     watch to an arrow when it is executed as a stand-alone application.
  375.     
  376.     By the way, what can you say about memory usage of EventTutor?
  377.     This info is needed to fill out the SIZE resource.
  378.     
  379.     N.B. EventTutor's method of decoding the osEvt (=app4Evt) message is
  380.     incorrect according to Inside Macintosh VI-5-20.
  381.     
  382. p.160    N.B. The menu item number returned (implicitly) by MenuSelect is
  383.     the ID stored *inside* the corresponding MENU resource, not the ID
  384.     *of* the resource itself.  Often these IDs are kept the same.  If
  385.     you change the resource ID of a MENU resource, ResEdit will ask you
  386.     (just once) whether you want to change the internal menu ID as well.
  387.     The internal ID can also be changed by opening the resource using a
  388.     template.
  389.  
  390.     I ran into trouble when I accidentally created MENU resources with
  391.     the wrong IDs and later tried to change them.  First the program
  392.     failed to find the MENU resources (because the IDs in the program
  393.     were not the same as in the resource fork).  After changing them,
  394.     the program still failed to recognize the menu commands (because
  395.     the internal IDs were still wrong).
  396.  
  397. p.172    In the first comment line, HandleStyleChoice should read CheckStyles.
  398.  
  399. p.187    According to Inside Macintosh I-355, the low word of the return value
  400.     of MenuSelect is undefined if the high word is zero (no choice
  401.     condition).  Thus the code should read:
  402.     
  403.         theMenu := HiWord(menuChoice);
  404.         theItem := LoWord(menuChoice);
  405.         if (theMenu <> 0) then begin
  406.             case theMenu of ...
  407.  
  408. p.221    Again C code instead of Pascal: dialogDone = FALSE should of course
  409.     read dialogDone := FALSE.
  410.     
  411. p.230    Figure 6.22 contains a typo concerning items 9, 10, and 11 (look at the
  412.     Text fields).
  413.  
  414. p.246    Align case MINS_RADIO with others.  Here, it would also be appropriate
  415.     to introduce a procedure to toggle a control (again lots of duplicated
  416.     code).
  417.  
  418. p.251    By looking at the dialog in a slightly different way, DialogInit could
  419.     use RestoreSettings to set it up.  Of course, in that case you need to
  420.     iniitialize the global variables first.  Now there is a lot of code
  421.     duplication.
  422.  
  423. p.267/8    The text mentions locking the string handle.  This is not done in the
  424.     code.  It also not clear where it should be unlocked again.  Also see
  425.     p.194.  Should the code on p.268 for case SECS_RADIO read
  426.     
  427.         HLock(Handle(gDefaultSecsH));
  428.         SetIText(itemHandle,gDefaultSecsH^^);
  429.         HUnlock(Handle(gDefaultSecsH));
  430.         
  431.     and similarly for gDefaultMinsH in MINS_RADIO ?
  432.     
  433. p.391    Corrections: (1) Desktop file rebuilding is initiated by holding the
  434.     Command and Option keys *when first mounting the volume*.  For the
  435.     boot volume, mounting happens at startup; for floppies, when you
  436.     insert them for the first time.  (2) Rebuilding the desktop file
  437.     erases the Finder's Get Info comment texts for *ALL* files on the
  438.     volume, not just for applications.  [There exist utilities that save
  439.     these Get Info comments before rebuilding and restore them
  440.     afterwards.]  (3) In order to make a new icon show up it is not
  441.     necessary to rebuild the desktop file of the boot volume.  The THINK
  442.     Pascal documentation in fact recommends the following procedure
  443.     [THINK Pascal 3.0 Resource Utilities Manual, p.59]: copy your
  444.     application with its (not yet displaying icon) to a floppy; rebuild
  445.     the desktop of the floppy; copy the application back to your target
  446.     disk; and lo, the new icon shows up (the Finder quietly updates its
  447.     icon info in the desktop file of the target volume as well).
  448.  
  449. p.392    Should the 'vers' resource be purgeable?  (I guess so, since it is
  450.     not a MENU or MBAR.)  It might be nice to repeat this once more.
  451.     Readers like me hop through the book and either forget earlier
  452.     advice or haven't seen it yet.
  453.  
  454.  
  455. These comments cover only those parts of the book that I read more
  456. carefully.  I hope they can be of use to improve the next edition.
  457.  
  458.     Tom
  459. - -- 
  460. INTERNET: wstomv@win.tue.nl  /    Eindhoven University of Technology
  461. VOICE: +31 40 47 41 25      /    Dept of Mathematics & Computing Science
  462. FAX: +31 40 43 66 85       /    PO Box 513, NL-5600 MB Eindhoven, Netherlands
  463.  
  464. +++++++++++++++++++++++++++
  465.  
  466. From: scott@mcl.mcl.ucsb.edu (Scott Bronson)
  467. Date: 26 Apr 92 16:48:45 GMT
  468.  
  469. In <3373@svin02.info.win.tue.nl> wstomv@wsinpa01.win.tue.nl (Tom Verhoeff) writes:
  470. >    * Instead of
  471. >        done := FALSE;
  472. >        while (done = FALSE) do begin "statements" end
  473. >      at least write
  474. >        done := FALSE;
  475. >        while not done do begin "statements" end
  476. >      but preferrably even write
  477. >          done := FALSE;
  478. >        repeat "statements" until done
  479.  
  480. Only two out of three of these say the same thing.  Notice how in the
  481. first and second examples above, if [not done] evaluates to true, the
  482. code inside your while loop won't be executed even once.  However,
  483. in the third example above, the code inside your repeat loop will
  484. always be executed once, THEN the condition is checked.  A subtle
  485. difference, but it does matter.
  486.  
  487.  
  488.     - Scott
  489.  
  490. +++++++++++++++++++++++++++
  491.  
  492. From: Bruce.Hoult@bbs.actrix.gen.nz
  493. Date: 26 Apr 92 22:22:17 GMT
  494. Organization: Actrix Information Exchange
  495.  
  496. In article <scott.704306925@mcl> scott@mcl.mcl.ucsb.edu (Scott Bronson) writes:
  497. > In <3373@svin02.info.win.tue.nl> wstomv@wsinpa01.win.tue.nl (Tom Verhoeff) writes:
  498. > >    * Instead of
  499. > >        done := FALSE;
  500. > >        while (done = FALSE) do begin "statements" end
  501. > >      at least write
  502. > >        done := FALSE;
  503. > >        while not done do begin "statements" end
  504. > >      but preferrably even write
  505. > >          done := FALSE;
  506. > >        repeat "statements" until done
  507. > Only two out of three of these say the same thing.  Notice how in the
  508. > first and second examples above, if [not done] evaluates to true, the
  509. > code inside your while loop won't be executed even once.  However,
  510. > in the third example above, the code inside your repeat loop will
  511. > always be executed once, THEN the condition is checked.  A subtle
  512. > difference, but it does matter.
  513.  
  514.  
  515. Perhaps you didn't notice that done is set to FALSE initially?  The
  516. loop will *always* be executed at least once, whether in the while or
  517. repeat form.
  518.  
  519. Why test the condition initially when you *know* how it will turn out?
  520.  
  521. - -- 
  522. Bruce.Hoult@bbs.actrix.gen.nz   Twisted pair: +64 4 477 2116
  523. BIX: brucehoult                 Last Resort:  PO Box 4145 Wellington, NZ
  524. "Cray's producing a 200 MIPS personal computer with 64MB RAM and a 1 GB
  525. hard disk that fits in your pocket!"   "Great!  Is it PC compatable?"
  526.  
  527. ---------------------------
  528.  
  529. From: mgraf@sydvm1.VNET.IBM.COM (Michael Graf)
  530. Subject: List Box LDEF with icons
  531. Date: 24 Apr 92 18:49:17 GMT
  532. Organization: Australian Programming Centre (IBMA)
  533.  
  534.  
  535.   Recently, someone on the net mentioned that there was an Apple Snippet
  536. or sample code available that demonstrated how to write an LDEF (List Manager
  537. defintion ?) which displayed icons alongside the name of the list elements.
  538.  
  539.   Can anyone point me to where this snippet resides or what set of Apple
  540. Source code snippets it can be found in ?
  541.  
  542.   Thanx for the help, and to those that answered my previous query.
  543.  
  544.  
  545. **********************************************************************
  546. Regards,
  547.   Michael Graf                             (mgraf@sydvm1.vnet.ibm.com)
  548. **********************************************************************
  549.  
  550. +++++++++++++++++++++++++++
  551.  
  552. From: Keith_Rollin@taligent.com (Keith Rollin)
  553. Date: 24 Apr 92 18:56:38 GMT
  554. Organization: Taligent
  555.  
  556. In article <9204240406.AA20847@mammoth.Berkeley.EDU>, mgraf@sydvm1.VNET.IBM.COM
  557. (Michael Graf) writes:
  558. >   Recently, someone on the net mentioned that there was an Apple Snippet
  559. > or sample code available that demonstrated how to write an LDEF (List Manager
  560. > defintion ?) which displayed icons alongside the name of the list elements.
  561. >   Can anyone point me to where this snippet resides or what set of Apple
  562. > Source code snippets it can be found in ?
  563.  
  564. Here's an LDEF I wrote that shows selected items as checked, rather than
  565. hilited. It uses two 'sicn's to draw the two states of the checkbox. The
  566. resource ID's for the two icons are stored in the upper and lower words of the
  567. list's refcon. PlotIconID() is from Technote #306.
  568.  
  569. //--------------------------------------------------------------------------
  570.  
  571. pascal void main(    short        lMessage,        // what operation to do
  572.                     Boolean        lSelect,        // draw it selected?
  573.                     Rect*        lRect,            // where to draw the item
  574.                     Cell        lCell,            // which cell to draw
  575.                     short        lDataOffset,    // offset to data for drawing
  576.                     short        lDataLen,        // length of that data
  577.                     ListHandle    lHandle)        // handle to list record
  578. {
  579.     FontInfo        info;
  580.     ListPtr            listPtr;
  581.     Rect            iconRect;
  582.     Point            textLocation;
  583.     DataHandle        listCells;
  584.     unsigned char    oldState;
  585.  
  586.     switch (lMessage) {
  587.         case lInitMsg:
  588.             GetFontInfo(&info);
  589.             listPtr = *lHandle;
  590.             if (listPtr->cellSize.v < 16)
  591.                 listPtr->cellSize.v = 16;
  592.             listPtr->indent.h = listPtr->cellSize.v - info.leading;
  593.             listPtr->indent.v = listPtr->indent.h - info.descent;
  594.             break;
  595.  
  596.         case lDrawMsg:
  597.  
  598.             PenNormal();
  599.             EraseRect(lRect);
  600.         
  601.             PlotCheckBox(lRect, lHandle, lSelect);
  602.  
  603.             if (lDataLen > 0) {
  604.                 textLocation.h = 4 + 16 + 4;
  605.                 textLocation.v = lRect->top + (**lHandle).indent.v;
  606.                 MoveTo(textLocation.h, textLocation.v);
  607.  
  608.                 listCells = (**lHandle).cells;
  609.                 oldState = HGetState(listCells);
  610.                 HLock(listCells);
  611.                 DrawText((*listCells) + lDataOffset, 0, lDataLen);
  612.                 HSetState(listCells, oldState);
  613.             }
  614.             
  615.             break;
  616.  
  617.         case lHiliteMsg:
  618.             PlotCheckBox(lRect, lHandle, lSelect);
  619.             break;
  620.     }
  621. }
  622.  
  623.  
  624. void    PlotCheckBox(Rect* lRect, ListHandle lHandle, Boolean lSelect)
  625. {
  626.     Rect    iconRect;
  627.     long    refCon;
  628.     short    iconID;
  629.  
  630.     iconRect.left = 4;
  631.     iconRect.bottom = lRect->top + (**lHandle).indent.h;
  632.     iconRect.right = iconRect.left + 16;
  633.     iconRect.top = iconRect.bottom - 16;
  634.     refCon = (**lHandle).refCon;
  635.     iconID = (lSelect ? HiWord(refCon) : (short) refCon);
  636.     PlotIconID(&iconRect, atNone, ttNone, iconID);
  637. }
  638.  
  639.  
  640. - --
  641. Keith Rollin
  642. Phantom Programmer
  643. Taligent, Inc.
  644.  
  645.  
  646. ---------------------------
  647.  
  648. From: aep@world.std.com (Andrew E Page)
  649. Subject: Precompiled version of MacApp.h
  650. Date: 8 Apr 92 14:07:13 GMT
  651. Organization: The World Public Access UNIX, Brookline, MA
  652.  
  653.  
  654.    With alot of cursing and some fidling around I've managed to produce
  655. a precompiled version of MacApp.h.  I had to crank the partition of
  656. MPW Shell up to 9 Meg in order to do this and the resulting file is
  657. about 2.3 Meg long.  
  658.  
  659.    Would anyone be interested in having me post this to AppleLink
  660. or UUEncode it for the net?
  661.  
  662.  
  663. - -- 
  664. Andrew E. Page CTO(Warrior Poet)|   Decision and Effort The Archer and Arrow
  665. DSP Ironworks                   |     The difference between what we are
  666. Macintosh and DSP Technology    |           and what we want to be.
  667.  
  668. +++++++++++++++++++++++++++
  669.  
  670. From: mlanett@void.ncsa.uiuc.edu (Mark Lanett)
  671. Date: 8 Apr 92 15:05:10 GMT
  672. Organization: University of Illinois at Urbana
  673.  
  674. aep@world.std.com (Andrew E Page) writes:
  675.  
  676. >   With alot of cursing and some fidling around I've managed to produce
  677. >a precompiled version of MacApp.h.  I had to crank the partition of
  678. >MPW Shell up to 9 Meg in order to do this and the resulting file is
  679. >about 2.3 Meg long.  
  680.  
  681. All it takes is doing an "MABuild -CPlusLoad" and adding
  682. "{OtherLinkFiles} f {CPlusLoad}" to the .MAMakefile...
  683.  
  684. You might want to add '-CPlus -mf -Link -mf' to your MABuildDefaults in
  685. {MacApp}"Startup Files:Startup". Then you can drop your shell
  686. partition to 3Mb again and let it go to MultiFinder for the rest.
  687. The -CPlusLoad can be added there also.
  688.  
  689. >   Would anyone be interested in having me post this to AppleLink
  690. >or UUEncode it for the net?
  691.  
  692. Wouldn't do anyone else any good since (a) it is compiled for specific
  693. MABuild options, and (b) contains full pathnames.
  694. - -- 
  695. Mark Lanett, Software Tools Group, NCSA           mlanett@uiuc.edu or  NCSA.STG
  696. "People wander in and out of virtual rooms in virtual settings with virtual
  697. characters and virtual money and virtual armor and virtual weapons, which is
  698. virtually a good way to spend time, but not quite." -- Usenet Oracle
  699. - -- 
  700. Mark Lanett, Software Tools Group, NCSA           mlanett@uiuc.edu or  NCSA.STG
  701. "People wander in and out of virtual rooms in virtual settings with virtual
  702. characters and virtual money and virtual armor and virtual weapons, which is
  703. virtually a good way to spend time, but not quite." -- Usenet Oracle
  704.  
  705. +++++++++++++++++++++++++++
  706.  
  707. From: ksand@apple.com (Kent Sandvik)
  708. Date: 14 Apr 92 19:41:21 GMT
  709. Organization: MacDTS Mongols
  710.  
  711. In article <1992Apr8.150510.11046@ux1.cso.uiuc.edu>, mlanett@void.ncsa.uiuc.edu
  712. (Mark Lanett) writes:
  713. > aep@world.std.com (Andrew E Page) writes:
  714. > >   With alot of cursing and some fidling around I've managed to produce
  715. > >a precompiled version of MacApp.h.  I had to crank the partition of
  716. > >MPW Shell up to 9 Meg in order to do this and the resulting file is
  717. > >about 2.3 Meg long.  
  718. > All it takes is doing an "MABuild -CPlusLoad" and adding
  719. > "{OtherLinkFiles} f {CPlusLoad}" to the .MAMakefile...
  720. > You might want to add '-CPlus -mf -Link -mf' to your MABuildDefaults in
  721. > {MacApp}"Startup Files:Startup". Then you can drop your shell
  722. > partition to 3Mb again and let it go to MultiFinder for the rest.
  723. > The -CPlusLoad can be added there also.
  724.  
  725. Yes, I've seen people misusing the MPW shell partition sizes, a simple
  726. performance test would show how little this really helps if you use -mf.
  727. I wrote a TN about performance, and based on my tests I saw that the
  728. performance gains with large shells is marginal, if not actually missing.
  729. The -mf flag is really useful, because memory is then only used for 
  730. peak activities, like when the Cfront compiler kicks in. Have Swatch up
  731. and running while you compile and you will see how this all works.
  732.  
  733. As for the MacApp header dump, yes MacApp 3.0 has the -CPlusLoad flag
  734. defined as default, so you can't avoid using pre-compiled headers :-).
  735. (same with -mf, it's also default for all the tools that understands
  736. the flag).
  737.  
  738. Cheers,
  739. Kent Sandvik/dTs
  740.  
  741. +++++++++++++++++++++++++++
  742.  
  743. From: u_banzai@mcl.mcl.ucsb.edu ( )
  744. Date: 18 Apr 92 22:25:42 GMT
  745.  
  746. In <23037@goofy.Apple.COM> ksand@apple.com (Kent Sandvik) writes:
  747. >The -mf flag is really useful, because memory is then only used for 
  748. >peak activities, like when the Cfront compiler kicks in. Have Swatch up
  749. >and running while you compile and you will see how this all works.
  750.  
  751. But is there a version of Swatch that works on the Quadras?
  752. Mine will run, but it says "bad bad bad bad..." where the stack structures
  753. are supposted to be drawn.
  754.  
  755. - --
  756. =  Marc Tamsky    u_banzai@mcl.ucsb.edu    KB6JWE  =
  757.  
  758. +++++++++++++++++++++++++++
  759.  
  760. From: d88-jwa@hemul.nada.kth.se (Jon W{tte)
  761. Date: 19 Apr 92 09:41:21 GMT
  762. Organization: Royal Institute of Technology, Stockholm, Sweden
  763.  
  764. > u_banzai@mcl.mcl.ucsb.edu ( ) writes:
  765.  
  766.    But is there a version of Swatch that works on the Quadras?
  767.  
  768. Mine runs just fine. It's version 1.2.2.
  769.  
  770. - -- 
  771. "You should meet yourself someday. I'm sure you would hate it."
  772. - - Me: h+@nada.kth.se; Jon W{tte (The Diplomat - NOT!)
  773.  
  774. +++++++++++++++++++++++++++
  775.  
  776. From: ksand@apple.com (Kent Sandvik)
  777. Date: 21 Apr 92 23:02:39 GMT
  778. Organization: MacDTS Mongols
  779.  
  780. In article <u_banzai.703635942@mcl>, u_banzai@mcl.mcl.ucsb.edu ( ) writes:
  781. > In <23037@goofy.Apple.COM> ksand@apple.com (Kent Sandvik) writes:
  782. > >The -mf flag is really useful, because memory is then only used for 
  783. > >peak activities, like when the Cfront compiler kicks in. Have Swatch up
  784. > >and running while you compile and you will see how this all works.
  785. > But is there a version of Swatch that works on the Quadras?
  786. > Mine will run, but it says "bad bad bad bad..." where the stack structures
  787. > are supposted to be drawn.
  788.  
  789. Hmm, Swatch 1.2.2 and 1.7d5 (the one that shows the MultiFinder heap) seems
  790. to work fine with my Quadra. I don't run VM. Anyway, About Macintosh
  791. is a more crude way to watch MF memory use.
  792.  
  793. Cheers,
  794. Kent
  795.  
  796. +++++++++++++++++++++++++++
  797.  
  798. From: k044477@hobbes.kzoo.edu (Jamie R. McCarthy)
  799. Date: 22 Apr 92 14:14:14 GMT
  800. Organization: Kalamazoo College
  801.  
  802. ksand@apple.com (Kent Sandvik) writes:
  803. >u_banzai@mcl.mcl.ucsb.edu ( ) writes:
  804. >> 
  805. >> But is there a version of Swatch that works on the Quadras?
  806. >> Mine will run, but it says "bad bad bad bad..." where the stack structures
  807. >> are supposted to be drawn.
  808. >
  809. >Hmm, Swatch 1.2.2 and 1.7d5 (the one that shows the MultiFinder heap) seems
  810. >to work fine with my Quadra.
  811.  
  812. GateKeeper versions before 1.2.5 corrupt the System heap so delicately
  813. that (apparently) only Swatch and the Think Pascal debugger picked up on
  814. it.  1.2.5 fixes it.  Could this be your problem?
  815. - -- 
  816.  Jamie McCarthy     Internet: k044477@kzoo.edu     AppleLink: j.mccarthy
  817.  Youth culture killed my dog...
  818.  
  819. +++++++++++++++++++++++++++
  820.  
  821. From: ely@norton.com (Dave Ely)
  822. Organization: Symantec / Peter Norton
  823. Date: Sat, 25 Apr 1992 03:03:29 GMT
  824.  
  825. ksand@apple.com (Kent Sandvik) writes:
  826. > In article <u_banzai.703635942@mcl>, u_banzai@mcl.mcl.ucsb.edu ( ) writes:
  827. > > But is there a version of Swatch that works on the Quadras?
  828. > > Mine will run, but it says "bad bad bad bad..." where the stack structures
  829. > > are supposted to be drawn.
  830. > Hmm, Swatch 1.2.2 and 1.7d5 (the one that shows the MultiFinder heap) seems
  831. > to work fine with my Quadra. I don't run VM. Anyway, About Macintosh
  832. > is a more crude way to watch MF memory use.
  833.  
  834. Swatch 1.2.2 does not like 32 bit mode heaps. Go back to 24 bit mode for
  835. heap testing.
  836.  
  837. What was the 1.7d5 thing that shows the MultiFinder heap? Is that a newer
  838. version of Swatch?
  839. - -- 
  840.  ______________________________________________________________
  841.     Dave Ely                    | Internet:  ely@norton.com
  842.     Symantec/Peter Norton Group | AppleLink: Ely.D
  843.  
  844. ---------------------------
  845.  
  846. From: mgilula@NEWSSUN.MED.MIAMI.EDU (Marshall Gilula)
  847. Subject: ResEdit and 7.0
  848. Date: 24 Apr 92 07:05:33 GMT
  849.  
  850.  
  851. One of my favorite tiny hacks is on the "Special" menu bar item to 
  852. permit myself to use Command-F (for "Flush") for emptying the trash, etc.
  853. I have ResEdit 2.1.1 and both the Reference manual from APDA and the
  854. longer detailed book on Resedit, AND the assistance of one of my best
  855. hacker friends (he was familiar with the 2.XX Resedit) but neither of
  856. us could ever find the Special menu .   
  857.  
  858. help!
  859.  
  860. Marshall Gilula
  861. mgilula@newssun.med.miami.edu
  862.  
  863.  
  864. In pre-7.0 systems I was able to do the hack.
  865.  
  866. +++++++++++++++++++++++++++
  867.  
  868. From: mozart@coos.dartmouth.edu (Sting)
  869. Date: 24 Apr 92 12:57:30 GMT
  870. Organization: Dartmouth College, Hanover, NH
  871.  
  872. In <9204240705.AA25750@newssun.med.miami.edu> mgilula@NEWSSUN.MED.MIAMI.EDU (Marshall Gilula) writes:
  873.  
  874.  
  875. >One of my favorite tiny hacks is on the "Special" menu bar item to 
  876. >permit myself to use Command-F (for "Flush") for emptying the trash, etc.
  877. >I have ResEdit 2.1.1 and both the Reference manual from APDA and the
  878. >longer detailed book on Resedit, AND the assistance of one of my best
  879. >hacker friends (he was familiar with the 2.XX Resedit) but neither of
  880. >us could ever find the Special menu .   
  881.  
  882. >help!
  883.  
  884. >Marshall Gilula
  885. >mgilula@newssun.med.miami.edu
  886.  
  887. The reason you could do this in previous systems is that they used MENU
  888. resources for the finder menus.  Under System 7, there are 'fmnu' resources
  889. which contain not only the items and their cmd-key equivalents, but also
  890. the appleEvents they are associated with.
  891.  
  892. You can get a ResEdit 'fmnu' template from various anonymous ftp sites (try
  893. ftp.apple.com).  This should allow you to do this hack.
  894.  
  895. AppleEvents are very cool...you can add a "quit" command to the finder that
  896. actually MAKES IT QUIT without having to hack around in the CODE segments.
  897. Can't do that under previous systems!
  898.  
  899. Ciao!
  900. Mike
  901.  
  902.  
  903. - --
  904. Michael J. Fromberger            | Take a look at my new toy,
  905. Composer, Guitarist            | It'll blow your head in two, oh boy!
  906. Sting@Dartmouth.EDU                | Truth hits everybody
  907.   friendly email welcome!!         | Truth hits everyone...  (The Police)
  908.  
  909. +++++++++++++++++++++++++++
  910.  
  911. From: cconstantine@galaxy.gov.bc.ca
  912. Date: 24 Apr 92 14:45:22 GMT
  913. Organization: BC Systems Corporation
  914.  
  915. In article <9204240705.AA25750@newssun.med.miami.edu>, mgilula@NEWSSUN.MED.MIAMI.EDU (Marshall Gilula) writes:
  916. > One of my favorite tiny hacks is on the "Special" menu bar item to 
  917. > permit myself to use Command-F (for "Flush") for emptying the trash, etc.
  918. > I have ResEdit 2.1.1 and both the Reference manual from APDA and the
  919. > longer detailed book on Resedit, AND the assistance of one of my best
  920. > hacker friends (he was familiar with the 2.XX Resedit) but neither of
  921. > us could ever find the Special menu .   
  922. > help!
  923. > Marshall Gilula
  924. > mgilula@newssun.med.miami.edu
  925. > In pre-7.0 systems I was able to do the hack.
  926.  
  927. That's right, in pre 7.0 systems, you can find the menu.  In system 7, it's in
  928. the 'fmnu' resource.  Actually, a recent article in MacUser (2 to 3 months ago)
  929. told you how to do it!!!  I can't remember the resource numbers and such, but
  930. it is there because I've done it in my system.  I also use cmd-S for Shutdown
  931. and cmd-R for restart!!! Comes in handy.  
  932.  
  933. There are a set of extensions for ResEdit that will allow you to see the 'fmnu'
  934. resource like a STR resource (or something like that) out there on many ftp
  935. sites.  I posted this set to the net last year as well, but got flamed because
  936. many ppl asked for them but I shouldn't have posted them to c.s.m.p.  However,
  937. I did send them to c.s.m.binaries, they just never showed up!!!!
  938.  
  939. - -- 
  940. Carl.Constantine@BCSystems.gov.bc.ca
  941. Victoria, British Columbia, Canada
  942.  
  943. ---------------------------
  944.  
  945. End of C.S.M.P. Digest
  946. **********************
  947.